﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个4位数");
            string s = Console.ReadLine();
            int num = 0;
            for (int i = 0; i < s.Length; i++)
            {
                num = num + s[i] - '0';
            }
            Console.WriteLine(num);
            int.Parse(s);
        }
    }
}
